home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q24291 < prev    next >
Text File  |  1988-07-21  |  820b  |  26 lines

  1. Q24291 Bad Code Generation with Undefined Value of I
  2. C Compiler
  3. 5.00
  4. MS-DOS
  5.  
  6. Problem:
  7.    The compiler seems to generate incorrect code for a function call
  8. of the following form, where i1, i2 and I all are declared as ints:
  9.  
  10.    func((I = i1,I*I),(I = i2,I*I));
  11.  
  12. Response:
  13.    Please note that constructs such as the one above are quite
  14. unusual. Note that the value of I is undefined after the function
  15. call; most C programmers will avoid expressions that produce similar
  16. undefined side effects; therefore, very few customers will encounter
  17. this problem.
  18.    We recommend that you recode your function call (or change your
  19. macro) as follows avoid the undefined side effect and generate better
  20. code:
  21.  
  22.         foo ( i1*i1, i2*i2 );
  23.  
  24. Keywords:  TAR62152 buglist5.00 buglist5.10
  25. Updated  88/07/21 03:19
  26.